<?php
$template = $twig->loadTemplate("statystyki.html.twig"); 

class Heading {
    var $name;
    var $class;
    var $key;
    
    function __construct($key, $name, $class) {
        $this->key = $key;
        $this->name = $name;
        $this->class = $class;
    }
    
    function getSize() {
        if ($this->name!='Nazwa')
            return '10%';
        else
            return '';
    }
}


$header = array(
    new Heading('ID','ID','textc'),
    new Heading('time','Czas pracy','textc'),
    new Heading('name','Nazwa','textl'),
    new Heading('options','Opcje','textl'),
);

/*
$query ="...";
$result = mysql_query($query);
$array = array();
while ($row = mysql_fetch_assoc($result)) {
    $array[] = $row;
}
*/

$dane = array(
    0 => array(
        'ID' => 1,
        'name' => 'Bartosz Kalinowski',
        'time' => rand() % 123,
        'options' => 'A B C'
    ),
    1 => array(
        'ID' => 2,
        'options' => 'A B C',
        'name' => 'Ziutek',
        'time' => rand() % 123
    ),
    2 => array(
        'ID' => 3,
        'name' => 'Żdzisław',
        'options' => 'A B C',
        'time' => rand() % 123
    ),
    3 => array(
        'ID' => 4,
        'time' => rand() % 123,
        'name' => 'Bartosz Kalinowski',
        'options' => 'A B C'
    )
);


$zmienne = array(
    'headers' => $header,
    'title' => 'Statystyki',
    'dane' => $dane
);
?>
